export async function getWeather() {
  try {
    const res = await fetch(
      "https://mq2k5n9vhh.re.qweatherapi.com/v7/weather/now?location=101200105&lang=en",
      {
        method: "GET",
        headers: {
          "X-QW-Api-Key": "4f884b2f90a5468c9a10f99fcb404772",
        },
      }
    ).then((res) => res.json());

    if (res.code === "200") {
      return {
        text: res?.now?.text,
        temp: res?.now?.temp,
      };
    }

    return {};
  } catch (error) {
    console.error("Error fetching weather data:", error);
    return {};
  }
}
